#ifndef _MY_SEMAPHORE_H
#define _MY_SEMAPHORE_H

typedef struct semaphore{
  int id;
  int val;
} my_sem_t;

/* Initialize semaphore object SEM to VALUE */
int my_sem_init (my_sem_t * my_sem, unsigned int value);

/* Wait for SEM being posted.

   This function is a cancellation point and therefore not marked with
   __THROW.  */
int my_sem_wait (my_sem_t * my_sem);

/* Post SEM.  */
int my_sem_post (my_sem_t * my_sem);

#endif	/* my_semaphore.h */
